
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品详情</title>
    <style>
        *{
            margin: 0 auto;
            padding: 0;
            list-style: none;
        }
        .header-a{
            text-decoration: none;
            color: #CCCCCC;
        }
        .header-a:hover{
            color: black;
        }
        .header_li1{
            float: left;
            line-height: 30px;
            margin-left: 24px;
            text-align: center;
        }
        .header_li1 a{
            color:#FFFFFF;
            text-decoration: none;
            font-size: 13px;
            border-right: #CCCCCC;
        }
        .header_li1 a:hover{
            color:#FFFF00;
        }

        .li1{
            list-style: none;
            height: 35px;
            margin-left: 5px;
            margin-right: 5px;
            line-height: 35px;
            border-bottom: 1px #FFE2E2 solid;
        }
        .span1{
            color: #F5D695;
            position: absolute;
            right: 18px;
        }
        .acTitle{
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp:1;
            -webkit-box-orient: vertical;
        }
    </style>
    <script src="js/jquery-3.1.1.min.js"></script>
    <script>
        function addToCar() {
            var articleNum = $("#articleNum").val();
            var articleId  = $("#articleId").val();
            $.get("addToShopCar",{articleId:articleId,articleNum:articleNum},function(data) {
                alert(data.msg)
            },"json")
        }
        $(function () {
            var userName = "${user.name}"
            var text = "[<a href= 'toLoginPage'>登录</a>]&nbsp;[<a href= 'toRegisterPage'>免费注册</a>]"
            if(userName != "") {
                text = userName + "&nbsp;&nbsp[<a href= 'logout'>注销</a>]";
            }
            $("#loginSpan").html(text)

            $("#subButton").click(function(){
                var articleNum = $("#articleNum").val();
                if(articleNum  <= 1) {
                    $("#articleNum").val(1)
                }else {
                    $("#articleNum").val(parseInt($("#articleNum").val()) - 1)
                }
            })
            $("#plusButton").click(function(){
                $("#articleNum").val(parseInt($("#articleNum").val()) + 1)

            })
            var price = ${article.price}
            var discount = ${article.discount}
                function computePrice() {
                    var result = (price * discount).toFixed(2);
                    return  result;
                }
            $("#realPrice").html(computePrice());


        })
    </script>
</head>
<body>
<div style="height: 32px;width: 100%;background-color: #EFEFEF;">
    <!--头页的第一部分-->
    <div style="height: 32px;width: 1000px;font-size: 12px;line-height: 32px;text-align:right">
        官方网站<a href="https://www.douyu.com/directory/myFollow">http://gz.gec-edu.org/?gzbdgzbdyueqianpc23</a>
        <span id="loginSpan"></span>
        [<a href="toShopCarPage">我的购物车</a>]
        [<a href="toOrderDetailPage">我的订单</a>]
        [<a href="#">设置为首页</a>]
        [<a href="#">加入收藏</a>]
    </div>
    <!--头页的第二部分-->
    <div style="width: 1000px;height: 150px;;position: relative">
        <img src="images/article/logo.gif">
        <img src="images/banner.gif" alt="" style="margin-top: 10px">

        <div style="position: absolute;right: 50px;top: 30px;font-size: 12px">
            <div style="border: 1px solid #CCCCCC;width: 70px;height: 20px;line-height:20px;text-align: center"><a href="#" style="" class = "header-a">关于我们</a></div>
            <div style="margin-top: 10px;border: 1px solid #CCCCCC;width: 70px;height: 20px;line-height:20px;text-align: center"><a href="#" style="" class = "header-a">联系方式</a></div>
        </div>
    </div>
    <!--头页的第三部分-->
    <div style="width: 100%;height: 30px;background-color: #CC3333 ">
        <div style="width: 1000px;height: 30px;">
            <ul>
                <li class="header_li1"><a href="#"> 首页</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0001"> 护肤</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0002"> 彩妆</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0003"> 香氛</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0004"> 身体护理</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0005"> 礼盒套装</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0006"> 母婴专区</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0007"> 男士专区</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0008"> 粉底</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0009"> 粉饼</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0010"> 睫毛膏</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0011"> 唇彩</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0012"> 腮红</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0013"> 食品保障</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0014"> 瘦身类</a></li>
                <li class="header_li1"><a href="getArticleType?type_code=0015"> 美容类</a></li>
            </ul>

        </div>

    </div>
</div>


<div style="width: 1000px;height: 800px;position: relative;margin-top: 195px">
    <%--第一部分--%>
    <div style="width: 250px;height: 600px;background-color:#FEA913;position: absolute;left:0px ">
        <p style="color:#884E16;font-weight: bold;margin-left: 15px;margin-top: 5px">物品分类</p>
        <div style="background-color:white;width: 244px;height: 570px">
            <ul>
                <li class="li1"><a href="#"style="text-decoration: none">首页 </a>   <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0001" style="text-decoration: none">护肤 </a>  <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0002" style="text-decoration: none">彩妆 </a>  <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0003" style="text-decoration: none">香氛 </a>  <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0004" style="text-decoration: none">身体护理</a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0005" style="text-decoration: none">礼盒套装</a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0006" style="text-decoration: none">母婴专区</a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0007" style="text-decoration: none">男士专区</a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0008" style="text-decoration: none">粉底 </a>  <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0009" style="text-decoration: none">粉饼 </a>  <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0010" style="text-decoration: none">睫毛膏 </a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0011" style="text-decoration: none">唇彩 </a>   <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0012" style="text-decoration: none">腮红 </a>   <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0013" style="text-decoration: none">食品保健</a> <span class="span1">&gt;</span></li>
                <li class="li1"><a href="getArticleType?type_code=0014" style="text-decoration: none">瘦身类 </a> <span class="span1">&gt;</span> </li>
                <li class="li1"><a href="getArticleType?type_code=0015" style="text-decoration: none">美容类 </a> <span class="span1">&gt;</span> </li>
            </ul>
        </div>
    </div>
   <%--第二部分--%>
    <div style="text-align:center;width:750px;height: 600px;position: absolute;left:250px">
        <p class="acTitle">${article.title}</p>
        <div style="width: 300px;height: 400px;position: absolute;left: 0px;top:30px">
            <div style="width: 300px;height: 300px; border:1px #CCCCCC solid">
                <img width="250px" src="images/article/${article.image}" style="margin-top: 40px">
                <div style="margin-top: 20px">
                    <p>评分：&nbsp;&nbsp;&nbsp;<span style="color:#F7BD02;">❤❤❤❤</span><a href="#">(已有151人评价)</a> </p>
                    <span><a href="#">该商品支持全国购买</a> </span>
                </div>
            </div>
        </div>
        <div style="width: 450px;height: 400px;position: absolute;left: 300px;top: 30px">
            <div style="width:400px;height: 400px;margin-left: 20px;border-top: 1px #CCCCCC solid">
                <table align="left" cellspacing="5px"style="font-size: 11px">
                    <tr>
                        <td style="width: 65px;">供应商：</td>
                        <td><span style="font-weight: bold">${article.supplier}</span></td>
                    </tr>
                    <tr>
                        <td>出产地：</td>
                        <td><span style="font-weight: bold">${article.locality}</span></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>定&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价：</td>
                        <td>￥${article.price}</td>
                    </tr>
                    <tr style="color: red">
                        <td>疯&nbsp;&nbsp;狂&nbsp;&nbsp;价：</td>
                        <td>￥<span id="realPrice"></span>（${article.discount}折）</td>
                    </tr>
                    <tr>
                        <td>库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存：</td>
                        <td>${article.storage} 下单后立即发货</td>
                    </tr>
                    <tr style="color: red">
                        <td>促销信息：</td>
                        <td>该商品参加满减活动，购买活动商品每减300元，可减100现金</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr style="height: 100px;background-color: #FFFCEB;margin-top: 10px;position: relative">
                        <td colspan="2" style="border: 2px #F4E6A9 solid">
                            <div style="border-bottom: 2px #F4E6A9 solid;line-height: 40px">
                                我要购买：<input id="subButton" type="button"  value="&nbsp;&nbsp;-&nbsp;&nbsp;"><input id="articleNum" type="number" value="1" style="width: 50px;text-align: center"><input id="plusButton" type="button" value="&nbsp;&nbsp;+&nbsp;&nbsp;">
                            </div>
                            <input type="hidden" id="articleId" value="${article.id}">
                            <div>
                                <a href="javascript:;" onclick="addToCar()" style="margin-left: 10px"><img src="images/car.png" alt="没找到图片" style="height: 26px "></a> &nbsp;<a href="#"><img src="images/btn_attention.jpg" style="margin-top:10px"></a>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

<%@include file="/footer.jsp" %>

</body>
</html>
